<?php

/**
 * sitetreeLive form base class.
 *
 * @method sitetreeLive getObject() Returns the current form's model object
 *
 * @package    sf_sandbox
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormGeneratedTemplate.php 29553 2010-05-20 14:33:00Z Kris.Wallsmith $
 */
abstract class BasesitetreeLiveForm extends BaseFormDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'ID'                => new sfWidgetFormInputHidden(),
      'ClassName'         => new sfWidgetFormChoice(array('choices' => array('SiteTree' => 'SiteTree', 'Page' => 'Page', 'ErrorPage' => 'ErrorPage', 'RedirectorPage' => 'RedirectorPage', 'VirtualPage' => 'VirtualPage'))),
      'Created'           => new sfWidgetFormDateTime(),
      'LastEdited'        => new sfWidgetFormDateTime(),
      'URLSegment'        => new sfWidgetFormInputText(),
      'Title'             => new sfWidgetFormInputText(),
      'MenuTitle'         => new sfWidgetFormInputText(),
      'Content'           => new sfWidgetFormTextarea(),
      'MetaTitle'         => new sfWidgetFormInputText(),
      'MetaDescription'   => new sfWidgetFormTextarea(),
      'MetaKeywords'      => new sfWidgetFormInputText(),
      'ExtraMeta'         => new sfWidgetFormTextarea(),
      'ShowInMenus'       => new sfWidgetFormInputText(),
      'ShowInSearch'      => new sfWidgetFormInputText(),
      'HomepageForDomain' => new sfWidgetFormInputText(),
      'ProvideComments'   => new sfWidgetFormInputText(),
      'Sort'              => new sfWidgetFormInputText(),
      'HasBrokenFile'     => new sfWidgetFormInputText(),
      'HasBrokenLink'     => new sfWidgetFormInputText(),
      'Status'            => new sfWidgetFormInputText(),
      'ReportClass'       => new sfWidgetFormInputText(),
      'CanViewType'       => new sfWidgetFormChoice(array('choices' => array('Anyone' => 'Anyone', 'LoggedInUsers' => 'LoggedInUsers', 'OnlyTheseUsers' => 'OnlyTheseUsers', 'Inherit' => 'Inherit'))),
      'CanEditType'       => new sfWidgetFormChoice(array('choices' => array('LoggedInUsers' => 'LoggedInUsers', 'OnlyTheseUsers' => 'OnlyTheseUsers', 'Inherit' => 'Inherit'))),
      'ToDo'              => new sfWidgetFormTextarea(),
      'Version'           => new sfWidgetFormInputText(),
      'Priority'          => new sfWidgetFormInputText(),
      'ParentID'          => new sfWidgetFormInputText(),
    ));

    $this->setValidators(array(
      'ID'                => new sfValidatorChoice(array('choices' => array($this->getObject()->get('ID')), 'empty_value' => $this->getObject()->get('ID'), 'required' => false)),
      'ClassName'         => new sfValidatorChoice(array('choices' => array(0 => 'SiteTree', 1 => 'Page', 2 => 'ErrorPage', 3 => 'RedirectorPage', 4 => 'VirtualPage'), 'required' => false)),
      'Created'           => new sfValidatorDateTime(array('required' => false)),
      'LastEdited'        => new sfValidatorDateTime(array('required' => false)),
      'URLSegment'        => new sfValidatorString(array('max_length' => 255, 'required' => false)),
      'Title'             => new sfValidatorString(array('max_length' => 255, 'required' => false)),
      'MenuTitle'         => new sfValidatorString(array('max_length' => 100, 'required' => false)),
      'Content'           => new sfValidatorString(array('required' => false)),
      'MetaTitle'         => new sfValidatorString(array('max_length' => 255, 'required' => false)),
      'MetaDescription'   => new sfValidatorString(array('required' => false)),
      'MetaKeywords'      => new sfValidatorString(array('max_length' => 255, 'required' => false)),
      'ExtraMeta'         => new sfValidatorString(array('required' => false)),
      'ShowInMenus'       => new sfValidatorInteger(array('required' => false)),
      'ShowInSearch'      => new sfValidatorInteger(array('required' => false)),
      'HomepageForDomain' => new sfValidatorString(array('max_length' => 100, 'required' => false)),
      'ProvideComments'   => new sfValidatorInteger(array('required' => false)),
      'Sort'              => new sfValidatorInteger(array('required' => false)),
      'HasBrokenFile'     => new sfValidatorInteger(array('required' => false)),
      'HasBrokenLink'     => new sfValidatorInteger(array('required' => false)),
      'Status'            => new sfValidatorString(array('max_length' => 50, 'required' => false)),
      'ReportClass'       => new sfValidatorString(array('max_length' => 50, 'required' => false)),
      'CanViewType'       => new sfValidatorChoice(array('choices' => array(0 => 'Anyone', 1 => 'LoggedInUsers', 2 => 'OnlyTheseUsers', 3 => 'Inherit'), 'required' => false)),
      'CanEditType'       => new sfValidatorChoice(array('choices' => array(0 => 'LoggedInUsers', 1 => 'OnlyTheseUsers', 2 => 'Inherit'), 'required' => false)),
      'ToDo'              => new sfValidatorString(array('required' => false)),
      'Version'           => new sfValidatorInteger(array('required' => false)),
      'Priority'          => new sfValidatorString(array('max_length' => 5, 'required' => false)),
      'ParentID'          => new sfValidatorInteger(array('required' => false)),
    ));

    $this->widgetSchema->setNameFormat('sitetree_live[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'sitetreeLive';
  }

}
